using System;
using DecisionMaking.BusinessLogic.Model;
using DecisionMaking.Domain;
using System.Collections.Generic;
namespace DecisionMaking.BusinessLogic
{
    /// <summary>
    /// Respomsible for AlgorithmDefinition CRUD operations, listing all IAlgorithm implementations and instantiating IAlgorithms
    /// </summary>
	public interface IAlgorithmManager
	{
	    /// <summary>
	    /// Creates or updates the specified algorithm definition in persistent storage 
	    /// </summary>
	    /// <param name="model"></param>
	    AlgorithmDefinition SaveAlgorithmDefinition(AlgorithmDefinitionModel model);
		
        /// <summary>
        /// Loads the algorithm definition with the specified id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
		AlgorithmDefinition GetAlgorithmDefinition(int id);
		
		/// <summary>
		/// Retrieves a list of all algorithms created by a superuser or the specified account 
		/// </summary>
		/// <param name="accountId">
		/// A <see cref="System.Int32"/>
		/// </param>
		/// <returns>
		/// A <see cref="IList<AlgorithmDefinition>"/>
		/// </returns>
		IList<AlgorithmDefinition> GetAlgorithmDefinitions(int accountId);

	    /// <summary>
	    /// Returns a dictionary mapping of all concrete IAlgorithm implementations in the system to their simple names
	    /// </summary>
	    /// <returns></returns>
	    IDictionary<string, string> GetEngineNames();
		
		/// <summary>
		/// Factory method for creating an IAlgorithm instance for the specified algorithm definition 
		/// </summary>
		/// <param name="algorithmDefinition">
		/// A <see cref="AlgorithmDefinition"/>
		/// </param>
		/// <returns>
		/// A <see cref="IAlgorithm"/>
		/// </returns>
		IAlgorithm GetAlgorithmInstance(AlgorithmDefinition algorithmDefinition);
	}
}

